program eva;

var  aa,x,longorder:array[0..20] of integer;
     site,n,i,j,d,k,max:integer;

begin
  n:=0;
  while not eoln do
    begin
      inc(n);
      read(aa[n]);
    end;

  site:=1;x[1]:=0;max:=0;aa[0]:=maxint;
  while site>0 do
    begin
       inc(x[site]);
       while (aa[x[site]]>=aa[x[site-1]])and(x[site]<=n) do
         begin
           inc(x[site]);
         end;
       if x[site]>n then
          begin
            if site-1>max then
              max:=site-1;
            site:=site-1;
          end
       else
         begin
           inc(site);
           x[site]:=x[site-1];
         end;
    end;

  writeln(max);
  site:=0;
end.
